-- card: 26199 from stack: in -- bmap block id: 0 -- flags: 0000 -- background id: 4755 -- name: -- part contents for background part 4 ----- text ----- Frequently pointers are used to structure variables. A special operator '->' is used in place of the dot operator to access members of a structure pointed to by a pointer variable, to avoid cumbersome syntax. It is important to remember to define a non-pointer variable as well in order to allocate space for the structure itself: struct personnel_rec *person_ptr, jack; person_ptr = &jack; /* if you forget this you may crash the program! */ person_ptr->salary = 1.5e6; /* same as: (*person_ptr).salary = 1.5e6 */ The same array-pointer relationship holds as that for the basic data types. struct personnel_rec person[10]; (person+1)->salary = 1.5e6; /* ok since space is allocated in previous line */ It is illegal to declare a member of a struct to be a variable of the same user-defined type. For example, a personnel_rec variable may not be a member of the personnel_rec type, for obvious reasons. However, it is legal to declare a member to -- part contents for background part 7 ----- text ----- 68